<?php
define("HOST", "localhost");
define("USER", "root");
define("PASS", "123456");
define("DATABASE", "cb_shop");
//1、建立链接
$link = mysqli_connect(HOST,USER,PASS);
if (!$link){
    exit("数据库链接失败！");
}
//2、选择数据库
mysqli_select_db($link,DATABASE);
?>